package form;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;

import trangchu.UtilDelegate;

public class DSJ_DonVi {
	public String MaDV;
	public String TenDV;
	public String getMaDV() {
		return MaDV;
	}
	public void setMaDV(String maDV) {
		MaDV = maDV;
	}
	public String getTenDV() {
		return TenDV;
	}
	public void setTenDV(String tenDV) {
		TenDV = tenDV;
	}
	
	public Vector<DSJ_DonVi> getUsers(){
		Vector list = new Vector();;
		Connection con =UtilDelegate.getConnection();		
		PreparedStatement st;
		try {
			st = con.prepareStatement("select * from DonVi");
			ResultSet rs = st.executeQuery();
			while(rs.next()){
				
				Vector<String> b = new Vector<String>();
				rs.getString("MaDV");
				rs.getString("TenDV");
				list.add(b.toString());
								
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		return list;
	}
	
}
